<?php include "../public/header.php";?>
<?php include "../public/header_show.php";?>
<body id="xiangqingPage">
<div id="xiangqingBox">
    <div class="page-title">
        <div class="page-title-con">
            <span class="pageshowtitle">详情</span>
            <div class="page-title-opt-list">
                <?php include "../public_flow/flow_show_optbut.php";?>
                <button class="layui-btn layui-btn-sm btn-light marginr5 opt">
                    操作<i class="layui-icon layui-icon-down layui-font-12"></i>
                </button>
                <span id="page-close" class="page-close" onclick="layer_close()">×</span>
            </div>
        </div>
    </div>
    <div class="main-container">
        <div><?php include "../public_flow/flow_show_info.php";?></div>
        <div class="tongbox tongbox5">
            <div class="tuo"><div class="tit">项目名称</div><div class="con" id="tong_enginname"></div></div>
            <div class="tuo"><div class="tit">开票单号</div><div class="con" id="tong_number"></div></div>
            <div class="tuo"><div class="tit">发票类型</div><div class="con" id="tong_piaotype_name"></div></div>
            <div class="tuo"><div class="tit">本次开票金额含税(元)</div><div class="con" id="tong_money"></div></div>
            <div class="tuo"><div class="tit">开票状态</div><div class="con" id="tong_state_name"></div></div>
        </div>
        <div class="table-box tablenes">
            <div class="title">项目信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">项目名称</td><td class="tv colorlan" id="enginid_name" colspan="3"></td></tr>
                </tbody>
            </table>
        </div>

        <div class="table-box tablenes">
            <div class="title">本次申请开票</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">开票单号</td><td id="number" class="tv"></td><td class="tt">发票类型</td><td id="piaotype_name" class="tv"></td></tr>
                <tr><td class="tt">开票主题</td><td id="title" class="tv"></td><td class="tt">本次开票金额含税(元)</td><td id="money" class="tv"></td></tr>
                <tr><td class="tt">税率(%)</td><td id="rate" class="tv"></td><td class="tt">税额(元)</td><td id="ratefee" class="tv"></td></tr>
                <tr><td class="tt">受票单位</td><td id="shouer" class="tv"></td><td class="tt">统一社会信用代码</td><td id="ratenum" class="tv"></td></tr>
                <tr><td class="tt">开户行</td><td id="unitbkname" class="tv"></td><td class="tt">账号</td><td id="unitbknum" class="tv"></td></tr>
                <tr><td class="tt">地址</td><td id="unitaddr" class="tv"></td><td class="tt">电话</td><td id="unittel" class="tv"></td></tr>
                <tr><td class="tt">施工地点</td><td id="shiaddr" class="tv"></td><td class="tt">开票单位</td><td id="kaier_name" class="tv"></td></tr>
<!--                <tr><td class="tt">开票日期</td><td id="dt" class="tv"></td><td class="tt">经办人</td><td id="baner" class="tv"></td></tr>-->

                <tr><td class="tt">备注</td><td class="tv" id="explain" colspan="3"></td></tr>
                </tbody>
            </table>
        </div>

        <div class="table-box tablenes buisness2 layui-hide">
            <div class="title">本次开票收取税费</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">本次开票应计税费(元)</td><td id="yingshuifee" class="tv"></td></tr>
                <tr><td class="tt">税费收取说明</td><td id="shuishuo" class="tv"></td></tr>
                <tr><td class="tt">税费收取方式</td><td id="shuiqutype_name" class="tv"></td></tr>
                <tr class="shuiqutype3 layui-hide"><td class="tt">关联费用扣收</td><td id="kouid_name" class="tv colorlan"></td></tr>
                </tbody>
            </table>
        </div>

        <div class="table-box tablenes">
            <div class="title">开票信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">是否开票</td><td id="state_name" class="tv"></td></tr>
                <tr><td class="tt">开票日期</td><td id="dt" class="tv"></td></tr>
                <tr><td class="tt">经办人</td><td id="baner" class="tv"></td></tr>
                </tbody>
            </table>
        </div>

        <div><?php include "../public/upinfo_show.php";?></div>

        <div><?php include "../public_flow/flow_show_flowrelas.php";?></div>

        <div class="table-box tablenes">
            <script type="text/html" id="toolbarDemo">发票明细<span class="colorhui">（申请通过后，由财务填写）</span></script>
            <div class="tableShow">
                <table id="datalist" lay-filter="datalist"></table>
            </div>
        </div>

        <div><?php include '../public_flow/flow_show_shenlog.php'?></div>
        <div><?php include '../public_flow/flow_show_talk.php'?></div>
        <div><?php include '../public/opt_browse.php'?></div>
    </div>

    <?php include 'showrrboxtext.php'?>
    <div><?php include '../public/shrrbox.php'?></div>
</div>
<script>
    var param_id = getQueryVariable('id') || 0;

    layui.use(['form', 'layer', "laytp",'element','dropdown','laypage','table','soulTable'], function() {
        var laypage = layui.laypage, table = layui.table, dropdown = layui.dropdown, form = layui.form, soulTable = layui.soulTable,element = layui.element;

        facade.ajax({url: ask_piao_kai_show, data:{id: param_id}}).done(function(res){
            if (res.code === 2000) {
                var data = res.data.data;
                var engininfo = res.data.engininfo;
                var kouidinfo = res.data.kouidinfo;

                $("#flowdingname").text(data.title);


                if(engininfo){
                    $("#tong_enginname").text(engininfo.name);
                }
                $("#tong_number").text(data.number);
                $("#tong_piaotype_name").text(data.piaotype_name);
                $("#tong_money").text(parseFormatNum(data.money));
                $("#tong_state_name").text(data.state_name);


                set_right_relainfo(engininfo);











                if(engininfo){
                    $("#enginid_name").text(engininfo.name).click(function () {
                        openPage('../engin/show.php?id='+engininfo.id);
                    });
                    if(engininfo.business == 2){
                        $(".buisness2").removeClass('layui-hide');
                    }
                }
                if(kouidinfo){
                    $("#kouid_name").text(kouidinfo.number+'（'+kouidinfo.money+'）').click(function () {
                        openPage('../shou_xiang/show.php?id='+kouidinfo.id);
                    });
                }



                $("#number").text(data.number);
                $("#title").text(data.title);
                $("#money").text(showChineseNumber(data.money));
                $("#ratefee").text(showChineseNumber(data.ratefee));
                $("#piaotype_name").text(data.piaotype_name);
                $("#rate").text(data.rate);
                $("#shouer").text(data.shouer);
                $("#ratenum").text(data.ratenum);
                $("#unitbkname").text(data.unitbkname);
                $("#unitbknum").text(data.unitbknum);
                $("#unitaddr").text(data.unitaddr);
                $("#unittel").text(data.unittel);
                $("#shiaddr").text(data.shiaddr);
                $("#kaier_name").text(data.kaier_name);
                $("#yingshuifee").text(showChineseNumber(data.yingshuifee));
                $("#shuishuo").text(data.shuishuo);
                $("#shuiqutype_name").text(data.shuiqutype_name);
                $("#dt").text(data.dt);
                $("#baner").text(data.baner);
                $("#state_name").text(data.state_name);
                $("#explain").text(data.explain);

                if(data.shuiqutype == 3) {
                    $(".shuiqutype3").removeClass('layui-hide');
                }

                var mytableList = table.render({
                    elem: "#datalist",data:res.data.list, toolbar: '#toolbarDemo', page: false
                    ,limit:TabInitShow.limit,soulSort: TabInitShow.soulSort,method: TabInitShow.method, overflow: TabInitShow.overflow
                    ,defaultToolbar: TabInitShow.defaultToolbar,filter: TabInitShow.filter ,text: TabInitShow.text,totalRow: true
                    ,request: TabInitShow.request,response: TabInitShow.response,contextmenu:get_table_contextmenu(soulTable)
                    , cols: [[
                        {type:'numbers',title:'序号',totalRowText: '合计',fixed:'left'}
                        ,{field: 'nums', title: '发票号码'}
                        ,{field: 'fee', title: '不含税金额(元)',totalRow: true,align:'right',templet: function(d){return parseFormatNum(d.fee);}}
                        ,{field: 'rate', title: '税率(%)'}
                        ,{field: 'ratefee', title: '税额(元)',totalRow: true,align:'right',templet: function(d){return parseFormatNum(d.ratefee);}}
                        ,{field: 'money', title: '价税合计(元)',totalRow: true,align:'right',templet: function(d){return parseFormatNum(d.money);}}
                        ,{field: 'explain', title: '备注'}
                    ]]
                    , done: function (res) {
                        soulTable.render(this);
                    }
                });



                public_flow_show_display(res.data.billinfo);
                public_upload_show_file('upload_files', res.data.files);
                render_from();
            }
        });

        public_get_readsandlog('piao_kai', param_id);
    });



</script>
</body>
</html>




